<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:fo="http://www.w3.org/1999/XSL/Format"
    version='1.0' >
    <xsl:template match="dishes">
        <fo:root>
            <fo:layout-master-set>
                <fo:simple-page-master master-name="mainPage"
                     page-height="300mm" page-width="200mm"
                     margin-top="20mm" margin-bottom="20mm"
                     margin-left="20mm" margin-right="20mm">

                    <fo:region-body
                       margin-top="0mm" margin-bottom="10mm"
                       margin-left="0mm" margin-right="0mm"/>

                    <fo:region-after extent="20mm"/>
                </fo:simple-page-master>
            </fo:layout-master-set>

            <fo:page-sequence master-reference="mainPage">
                <fo:flow  flow-name="xsl-region-body">
                    <xsl:apply-templates/>
                </fo:flow>
            </fo:page-sequence>
        </fo:root>
    </xsl:template>

    <xsl:template match="dish/dishName" >
        <fo:block font-size="15pt"
            line-height="24pt" font-family="Arial" color="blue">
            Dish Name:
            <xsl:value-of select="." />

        </fo:block>
    </xsl:template>

    <xsl:template match="dish/calories">
        <fo:block font-size="15pt" line-height="24pt"
            font-family="Times New Roman"  color="black">
            Calories:
            <xsl:value-of select="."/>
        </fo:block>
    </xsl:template>

    <xsl:template match="dish/imageURL">
        <fo:block font-size="15pt" line-height="24pt"
            font-family="Arial"  color="black">
            <xsl:value-of select="."/>
            <xsl:variable name="image" select="."/>
            <fo:external-graphic src="url('images/dish/{$image}')"/>
        </fo:block>
    </xsl:template>
</xsl:stylesheet>